<?php 
include_once("conexion.class.php");

class Variables{
 //constructor	
 	var $con;
 	function Variables(){
 		$this->con=new DBManager;
 	}

	function insertar($campos){
		if($this->con->conectar()==true){			
			return mysql_query("INSERT INTO variables (var, valor, fecha) VALUES ('".$campos[0]."', '".$campos[1]."', Curdate())");
		}
	}
	
	function actualizar($campos,$id){
			

		if($this->con->conectar()==true){
			//print_r($campos);
			return mysql_query("UPDATE variables SET var = '".$campos[0]."', valor='".$campos[1]."' WHERE id = ".$id);
		}
	}
	
	
	function mostrar_variable($id){
		if($this->con->conectar()==true){
			return mysql_query("SELECT * FROM variables WHERE id=".$id);
		}
	}

	function mostrar_variables(){
		if($this->con->conectar()==true){
			return mysql_query("SELECT * FROM variables");
		}
	}

	function eliminar($id){
		if($this->con->conectar()==true){
			return mysql_query("DELETE FROM variables WHERE id=".$id);
		}
	}
}
?>